/**
 * 
 * author：gaoxingliang@outlook.com
 * created:2015年8月15日 上午10:34:39  
 */
package org.gxl.learn;

import java.io.File;

import jxl.Sheet;
import jxl.Workbook;

/**
 * 使用jxl读取excel
 * @author gxl
 *
 */
public class ReadExcelByJXL
{

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception
	{
		Workbook workbook = Workbook.getWorkbook(new File("test.xls"));
		Sheet s = workbook.getSheet(0);
		for (int i=0; i< s.getRows() ; i++)
		{
			for (int j = 0; j < s.getColumns(); j++)
			{
				//注意参数是：
				//Cell getCell(int column, int row)
				System.out.print(s.getCell(j,  i).getContents() + " ");
			}
			System.out.println();
		}
		workbook.close();
	}

}
